package com.hongxun.design.ui.titlepopupwindow;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.view.View.OnClickListener;

import com.hongxun.design.bean.PopWindowItemBean;

/**
 * Created by zerdoor_pc on 2015/12/10.
 */
public class ActionItem {
    //定义图片对象
    public Drawable mDrawable;
    //定义文本对象
    public CharSequence mTitle;

    public CharSequence icon;
    public OnClickListener listener;

    public ActionItem(Drawable drawable, CharSequence title){
        this.mDrawable = drawable;
        this.mTitle = title;
    }

    public ActionItem(PopWindowItemBean bean){
        this.mTitle = bean.getTitle() ;
        this.icon = bean.getIcon();
        this.listener = bean.getListener();
    }

    public ActionItem(Context context, int titleId, int drawableId){
        this.mTitle = context.getResources().getText(titleId);
        this.mDrawable = context.getResources().getDrawable(drawableId);
    }

    public ActionItem(Context context, CharSequence title) {
        this.mTitle = title;
//        this.mDrawable = context.getResources().getDrawable(id);
    }
}
